home *** CD-ROM | disk | FTP | other *** search
- package Local.Game.Thing
- {
- import Local.Game.World.*;
- import Local.Game.World.Map.*;
- import Local.Game.World.Map.Cell.*;
- import Local.Math.*;
- import STC9.System.*;
- import flash.display.*;
- import flash.events.*;
- import flash.geom.*;
-
- public class CWeaponGunM1A1 extends CWeapon
- {
-
- public static var _Upgrades:Array = [{
- "mName":"",
- "mAmmo":INFINATEAMMO,
- "mAutoFire":true,
- "mFireRate":SECONDS * 2,
- "mDamage":100,
- "mRange":INFINATERANGE
- }];
-
-
- public function CWeaponGunM1A1()
- {
- super();
- §§push(§§findproperty(mAngleRange));
- §§push("min");
- §§push(-40 * 256 / 360);
- §§push("max");
- §§push(5 * 256);
- if(true)
- {
- §§push(§§pop() / 360);
- }
- §§pop().mAngleRange = null;
- mTargetAngle = new CAngle();
- mUpgrade = 0;
- mType = "gunm1a1";
- Process = Process_Normal;
- AddAnimation("stand",TankM1A1_Gun,"AddSprite_Black");
- mAngle.mAngle256 = mAngleRange.min * 0.25;
- mTargetAngle.mAngle256 = mAngle.mAngle256;
- AddSound("fire",Tank_Maingun);
- }
-
- override public function Fire() : void
- {
- AddThing(new CShotTankShell(GetShotPosition("gun"),mAngle.Clone()));
- PlaySound("fire");
- IncrementFired();
- }
-
- public function SetTarget(param1:CThingMain) : Boolean
- {
- if(param1.mPosition.x - mPosition.x > 100)
- {
- mCurrentTarget = param1;
- return true;
- }
- mCurrentTarget = null;
- return false;
- }
-
- public function GetShotPosition(param1:String) : CPosition
- {
- return GetObjectPosition(param1,mPosition);
- }
-
- override public function get mWeaponName() : String
- {
- return "gunm1a1";
- }
-
- override public function Draw() : void
- {
- if(true)
- {
- super.Draw();
- DrawSprite(GetOrientationMatrix());
- }
- }
-
- public function Process_Normal() : void
- {
- var _loc1_:CAngle = null;
- var _loc2_:CPosition = null;
- if(true)
- {
- if(mCurrentTarget)
- {
- _loc2_ = CPosition.SUBTRACT(mCurrentTarget.mCollide.mMid,mPosition);
- if(true)
- {
- if(_loc2_.x < 0)
- {
- if(true)
- {
- _loc2_.SetXY(-_loc2_.x,-_loc2_.y);
- }
- }
- mTargetAngle.mDelta = _loc2_;
- }
- }
- else
- {
- mTargetAngle.mAngle256 = mParent.mAngle.mAngle256;
- }
- }
- _loc1_ = new CAngle(mTargetAngle.mAngle - mAngle.mAngle);
- if(true)
- {
- mAngle.mAngle += _loc1_.mAngle * 0.5;
- if(true)
- {
- WeaponUpdate();
- }
- Process_Children();
- }
- }
-
- override public function get mUpgrades() : Array
- {
- return _Upgrades;
- }
- }
- }
-